All Questions
5 questions
5votes
2answers
3kviews
Hackerrank "Almost Equal" solution
I've spent the best part of a day on this question. It is marked as Expert level. There are about fifteen submission test cases and my solution manages to satisfy the first four. However, from there ...
3votes
1answer
1kviews
Sorting a 2-dimensional array with counting sort
The task I'm solving is: Sort a list by its keys Print out the corresponding values on one line separated by whitespace Replace the values of the first half of the input to "-" Use Counting Sort The ...
4votes
1answer
1kviews
Repeated comparison of sorted subarrays
This question is from a recently concluded competition on Codechef. You are given an array A of size n, and there are ...
3votes
3answers
389views
Sorting and eliminating duplicates
From Hacker Earth: Problem Statement: Chotu's father is the owner of a Vada Pav shop. One Sunday, his father takes him to the shop. Father tells him that at the end of the day, Chotu has to give him ...
5votes
3answers
1kviews
Counting number of inversions
This is a HackerEarth Challenge Problem. Question: Puchi hates to carry luggage, but unfortunately he got a job to carry the luggage of his N friends in office. Each day, one of his N friends, ...